import { SET_USER } from './types'
import { ActionType } from '@/types/routes'
const initialState = {
    userInfo: localStorage.getItem('userinfo') || {},//用户信息
    nenu: [],//动态菜单
    routes: [], //动态路由
}
function reducer(state = initialState, action: ActionType) {
    const { type, payload } = action
    switch (type) {
        case SET_USER:  //修改用户信息
            return { ...state, userInfo: payload }
        default:
            return state
    }
}
export default reducer